package com.wht;

import com.wht.domain.DtsUser;
import com.wht.mapper.DtsUserMapper;
import com.wht.service.DtsUserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * @author wanghaotian
 * time:2022/12/05,0005 12:24
 * description:
 */


@RunWith(SpringRunner.class)
@ContextConfiguration(locations = "classpath:spring/spring-mybatis-plus.xml")
public class Ttt {

    @Autowired
    DtsUserMapper userMapper;
    @Test
    public void test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring-mybatis-plus.xml");
        DtsUserMapper bean = context.getBean(DtsUserMapper.class);
        bean.findAll().stream().limit(10).forEach(System.out::println);

    }

    @Test
    public void test2(){
        List<DtsUser> list = userMapper.findAll();
        System.out.println(list);
    }


}
